﻿using System.Xml.Linq;

namespace NRank.Examples.Helpers
{
	/// <summary>
	/// XML document helper
	/// </summary>
	public static class XmlHelper
	{
		/// <summary>
		/// Content of example xml file
		/// </summary>
		private const string XmlContent =
			@"<?xml version=""1.0"" encoding=""utf-8\""?><root>
<muzeums />
  <muzeum>
    <name>Muzeum1</name>
    <entrance>100</entrance>
    <area>Area1</area>
  </muzeum>
  <muzeum>
    <name>Muzeum2</name>
    <entrance>50</entrance>
    <area>Area2</area>
  </muzeum>
  <muzeum>
    <name>Muzeum3</name>
    <entrance>120</entrance>
    <area>Area3</area>
  </muzeum>
  <muzeum>
    <name>Muzeum4</name>
    <entrance>100</entrance>
    <area>Area1</area>
  </muzeum>
  <muzeum>
    <name>Muzeum5</name>
    <entrance>40</entrance>
    <area>Area2</area>
  </muzeum>
  <muzeum>
    <name>Muzeum6</name>
    <entrance>10</entrance>
    <area>Area3</area>
  </muzeum>
  <hotels />
  <hotel>
    <name>Hotel1</name>
    <stars>5</stars>
    <area>Area1</area>
  </hotel>
  <hotel>
    <name>Hotel2</name>
    <stars>1</stars>
    <area>Area1</area>
  </hotel>
  <hotel>
    <name>Hotel3</name>
    <stars>2</stars>
    <area>Area2</area>
  </hotel>
  <hotel>
    <name>Hotel4</name>
    <stars>3</stars>
    <area>Area2</area>
  </hotel>
  <hotel>
    <name>Hotel5</name>
    <stars>4</stars>
    <area>Area3</area>
  </hotel>
</root>";

		/// <summary>
		/// XDocument loader
		/// </summary>
		/// <returns>Example XML document</returns>
		public static XDocument GetTestingDocument()
		{
			return XDocument.Parse(XmlContent);
		}
	}
}